package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    //根据菜品id查询对应套餐id

    List<Long> getSetmealIdByDishIds(List<Long> dishIds);


    //根据套餐id查询对应菜品id

    List<Long> getDishIdsBySetmealId(List<Long> setmealIds);

    //批量插入套餐菜品关系表
    void insertSetmealDishBatch(List<SetmealDish> setmealDishes);

    //根据SetmealIds删除套餐菜品关系表数据

    @Delete("delete from setmeal_dish where setmeal_id=#{setmealId}")
    void deleteBySetmealId(Long setmealId);

    //根据SetmealIds批量删除套餐菜品关系表数据
    void deleteBySetmealIds(List<Long> setmealIds);

    //根据套餐id查询对应套餐
    @Select("select * from setmeal_dish where setmeal_id=#{setmealId}")
    List<SetmealDish> getSetmealBySetmealId(Long setmealId);
}
